package com.example.viewpagerfragment;

import java.util.List;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

public class FragAdapter extends FragmentPagerAdapter {

    private List<Fragment> fragments;

    public FragAdapter(List<Fragment> fragments,FragmentManager fragmentManager){
       super(fragmentManager);
       this.fragments = fragments;
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
       return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }
}
